<div class="paginator text-center">
    <ul class="pagination pagination-sm">
        <li {{#lt collection.numberBefore 1}}class="disabled"{{/lt}}><a class="gopage" {{#gteq collection.numberBefore 1}}href="#" data-page="{{subtract collection.number 1}}"{{/gteq}}>«</a></li>

        {{#gteq collection.numberBefore 4}}
        <li><a class="gopage" href="#" data-page="0">1</a></li>
        {{#gteq collection.numberBefore 5}}
        <li class="disabled"><a>...</a></li>
        {{/gteq}}
        {{/gteq}}
        {{#gteq collection.numberBefore 3}}
        <li><a class="gopage" href="#" data-page="{{subtract collection.number 3}}">{{subtract collection.number 2}}</a></li>
        {{/gteq}}
        {{#gteq collection.numberBefore 2}}
        <li><a class="gopage" href="#" data-page="{{subtract collection.number 2}}">{{subtract collection.number 1}}</a></li>
        {{/gteq}}
        {{#gteq collection.numberBefore 1}}
        <li><a class="gopage"href="#" data-page="{{subtract collection.number 1}}">{{collection.number}}</a></li>
        {{/gteq}}

        <li class="active"><a>{{add collection.number 1}}</a></li>

        {{#gteq collection.numberAfter 1}}
        <li><a class="gopage" href="#" data-page="{{add collection.number 1}}">{{add collection.number 2}}</a></li>
        {{/gteq}}
        {{#gteq collection.numberAfter 2}}
        <li><a class="gopage" href="#" data-page="{{add collection.number 2}}">{{add collection.number 3}}</a></li>
        {{/gteq}}
        {{#gteq collection.numberAfter 3}}
        <li><a class="gopage" href="#" data-page="{{add collection.number 3}}">{{add collection.number 4}}</a></li>
        {{/gteq}}
        {{#gteq collection.numberAfter 4}}
        {{#gteq collection.numberAfter 5}}
        <li class="disabled"><a>...</a></li>
        {{/gteq}}
        <li><a class="gopage" href="#" data-page="{{subtract collection.totalPages 1}}">{{collection.totalPages}}</a></li>
        {{/gteq}}

        <li {{#lt collection.numberAfter 1}}class="disabled"{{/lt}}><a class="gopage" {{#gteq collection.numberAfter 1}}href="#" data-page="{{add collection.number 1}}"{{/gteq}}>»</a></li>
    </ul>
</div>
